/**
 *给定的颜色值计算浅色的颜色值
 * @param color
 * @param opacity
 * @returns string
 */
export function changeColorOpacity(color: string, opacity: number = 0.1) {
	// 将十六进制颜色转换为RGB格式
	const r = parseInt(color.slice(1, 3), 16);
	const g = parseInt(color.slice(3, 5), 16);
	const b = parseInt(color.slice(5, 7), 16);
	// 返回带有透明度的RGBA格式颜色
	return `rgba(${r}, ${g}, ${b}, ${opacity})`;
}
